package com.yanqu.road.server.cmd.building;

import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.pb.building.BuildingProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;


@Cmd(code = GameProtocol.S_OPEN_BUILDING_PAGE,desc = "打开店铺界面")
public class OpenBuildingCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        BuildingProto.OpenBuildingReqMsg req = BuildingProto.OpenBuildingReqMsg.parseFrom(packet.getBytes());
        int buildingId = req.getBuildingId();
        player.notifyListener(eGamePlayerEventType.DAY_FIRST_OPEN_BUILDING.getValue(),buildingId);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
